#ifndef STORAGE_H
#define STORAGE_H

#include <stddef.h>
#include <stdbool.h>
#include "models.h"

#define COURSE_FILE_PATH "courses.dat"
#define STUDENT_SELECTION_FILE_PATH "selections.dat"

/* 课程文件操作 */
bool save_course_append(const Course *course);
bool load_all_courses(Course **out_array, size_t *out_count);
bool rewrite_all_courses(const Course *array, size_t count);

/* 学生选课文件操作 */
bool save_selection_append(const StudentSelection *sel);
bool load_all_selections(StudentSelection **out_array, size_t *out_count);
bool rewrite_all_selections(const StudentSelection *array, size_t count);

/* 工具函数 */
bool file_exists(const char *path);

#endif /* STORAGE_H */


